import 'package:flutter/material.dart';
import 'package:url_launcher/url_launcher.dart';

class HelpFooter extends StatelessWidget {
  const HelpFooter({Key? key}) : super(key: key);

  Future<void> _launchEmail() async {
    final Uri emailUri = Uri(
      scheme: 'mailto',
      path: 'info@sodaapp.com',
      queryParameters: {
        'subject': 'سودا ئامبار سىستېمىسى ھەققىدە تەكلىپ ياكى پىكىر'
      },
    );
    
    if (!await launchUrl(emailUri)) {
      throw Exception('ئېلېكترونلۇق خەت ئەۋەتىش مۇۋەپپەقىيەتسىز بولدى');
    }
  }

  @override
  Widget build(BuildContext context) {
    return Column(
      children: [
        const SizedBox(height: 16),
        const Divider(),
        const SizedBox(height: 8),
        InkWell(
          onTap: _launchEmail,
          child: Row(
            mainAxisAlignment: MainAxisAlignment.center,
            children: [
              const Icon(
                Icons.email_outlined,
                color: Color(0xFF3F5491),
                size: 16,
              ),
              const SizedBox(width: 8),
              Text(
                'تەكلىپلىرىڭىز بولسا، ئېلخەت يوللاڭ',
                style: TextStyle(
                  fontSize: 12,
                  color: Colors.grey.shade700,
                  fontWeight: FontWeight.bold,
                ),
              ),
            ],
          ),
        ),
        const SizedBox(height: 8),
        Text(
          'info@sodaapp.com',
          style: TextStyle(
            fontSize: 12,
            color: Colors.blue.shade700,
            fontWeight: FontWeight.bold,
            decoration: TextDecoration.underline,
          ),
        ),
        const SizedBox(height: 8),
      ],
    );
  }
} 